Does casting an IList<T> to an array of type T[] cause enumeration?

Posted by Brian Triplett on Stack Overflow See other posts from Stack Overflow or by Brian Triplett
Published on 2010-03-16T15:04:30Z Indexed on 2010/03/16 15:11 UTC
Read the original article Hit count: 235

Filed under:
|
|
|

I have a method that looks like:

T[] field;

public Method(IList<T> argument)
{
    this.field = (T[])argument;
}

When the body of the method is executed does enumeration take place during the cast? Would that change if the underlying type was different?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET